<template>
  <div class="wx-text">
    <div :class="[`wx-text__${position}`,`wx-${position}`]" >
      <img :src="icon" class="wx-logo wx-text__logo" alt />

      <div :class="[`wx-text__${position}-box`]" @click="onClick">
        <span>{{content}}</span>
      </div>
    </div>
  </div>
</template>

<script>
import PropsMixin from '../mixins'
export default {
  mixins: [PropsMixin],
  methods: {
    onClick(){
      this.$emit('on-click',true)
    }
  },
}
</script>

<style lang="scss" scoped>
.wx-text {
  &__left {

    &-box {
      position: relative;
      margin-right: 50px;
      padding: 10px;
      border-radius: 3px;
      background-color: #f9f9f9;
      border: 1px solid #f1f1f1;

      &::before,
      &::after {
        position: absolute;
        content: '';
        width: 0;
        height: 0;
        border-style: solid;
      }

      &::after {
        top: 10px;
        left: -8px;
        border-width: 8px 8px 8px 0;
        border-color: transparent #f1f1f1 transparent transparent;
        z-index: 0;
      }

      &::before {
        top: 10px;
        left: -6px;
        border-width: 7px 7px 7px 0;
        z-index: 1;
        border-color: transparent #f9f9f9 transparent transparent;
      }
    }
  }

  &__right {

    &-box {
      margin: 0 0 0 50px;
      position: relative;
      padding: 10px;
      border-radius: 3px;
      background-color: rgb(152, 255, 101);
      border-color: rgb(152, 255, 101);

      &::before,
      &::after {
        position: absolute;
        content: '';
        width: 0;
        height: 0;
        border-style: solid;
      }

      &::after {
        top: 10px;
        right: -8px;
        border-width: 8px 0 8px 8px;
        border-color: transparent transparent transparent rgb(152, 255, 101);
        z-index: 0;
      }

      &::before {
        top: 10px;
        right: -6px;
        border-width: 7px 0 7px 7px;
        z-index: 1;
        border-color: transparent transparent transparent rgb(152, 255, 101);
      }
    }
  }

}
</style>
